/*
 * Ext GWT 2.2.5 - Ext for GWT
 * Copyright(c) 2007-2010, Ext JS, LLC.
 * licensing@extjs.com
 * 
 * http://extjs.com/license
 */
package com.rattsoftware.client.model;

import com.extjs.gxt.ui.client.data.BaseModelData;
import com.rattsoftware.server.admin.model.CourseUnit;

public class CourseUnitSummary extends BaseModelData {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private CourseUnit courseUnit;

	public CourseUnitSummary() {

	}

	public CourseUnitSummary(CourseUnit courseUnit) {
		setCourseUnit(courseUnit);
		setId(courseUnit.getId());
		setCourseUnitName(courseUnit.getName());
		setCourseUnitDescription(courseUnit.getDescription());
		setNoOfCreditUnits(courseUnit.getNumOfCreditUnits());
		setSemester(courseUnit.getSemester());
		setCourseUnitType(courseUnit.getType());
		setYear(courseUnit.getYear());
		setCourseUnitCode(courseUnit.getCourseCode());
	}
	
	public CourseUnitSummary(String id, String courseUnitName, String courseUnitDescription, String noOfCreditUnits,
			String semester, String courseUnitType, String year, String courseUnitCode) {
		setId(id);
		setCourseUnitName(courseUnitName);
		setCourseUnitDescription(courseUnitDescription);
		setNoOfCreditUnits(noOfCreditUnits);
		setSemester(semester);
		setCourseUnitType(courseUnitType);
		setYear(year);
		setCourseUnitCode(courseUnitCode);
	}

	public void setId(String id) {
		courseUnit.setId(id);
		set("courseUnitId", id);
	}

	public String getId() {
		return get("courseUnitId");
	}
	
	public String getCourseUnitName() {
		return get("courseUnitName");
	}

	public void setCourseUnitName(String courseUnitName) {
		courseUnit.setName(courseUnitName);
		set("courseUnitName", courseUnitName);
	}

	public String getCourseUnitDescription() {
		return get("courseUnitDescription");
	}

	public void setCourseUnitDescription(String courseUnitDescription) {
		courseUnit.setDescription(courseUnitDescription);
		set("courseUnitDescription", courseUnitDescription);
	}

	public String getNoOfCreditUnits() {
		return get("noOfCreditUnits");
	}

	public void setNoOfCreditUnits(String noOfCreditUnits) {
		courseUnit.setNumOfCreditUnits(noOfCreditUnits);
		set("noOfCreditUnits", noOfCreditUnits);
	}

	public String getSemester() {
		return get("semester");
	}

	public void setSemester(String semester) {
		courseUnit.setSemester(semester);
		set("semester", semester);
	}

	public String getCourseUnitType() {
		return get("courseUnitType");
	}

	public void setCourseUnitType(String courseUnitType) {
		courseUnit.setType(courseUnitType);
		set("courseUnitType", courseUnitType);
	}

	public String getYear() {
		return get("year");
	}

	public void setYear(String year) {
		courseUnit.setYear(year);
		set("year", year);
	}

	public String getCourseUnitCode() {
		return get("courseUnitCode");
	}

	public void setCourseUnitCode(String courseUnitCode) {
		courseUnit.setCourseCode(courseUnitCode);
		set("courseUnitCode", courseUnitCode);
	}

	public void setCourseUnit(CourseUnit courseUnit) {
		this.courseUnit = courseUnit;
	}

	public CourseUnit getCourseUnit() {
		return courseUnit;
	}
}
